import Vue from 'vue'
import VueRouter from 'vue-router'
import FilmCard from '../components/FilmCard.vue'
import Bottompage from '../components/Bottompage.vue'
import Header from '../components/Header.vue'
import Index from '../views/Index.vue'
import Home from '../views/Home.vue'
Vue.use(VueRouter);
Vue.component("film-card",FilmCard);
Vue.component("my-header",Header);
Vue.component("my-bottom",Bottompage);

const routes = [
  {
    path:"/",
    name: 'home',
    component:Home,
    redirect:{name:'index'},
    children:[
      {
        path:'index',
        name: 'index',
        component:Index
      },
      {
        path:'list',
        name: 'list',
        component:  () => import(/* webpackChunkName: "list" */ '../views/List.vue'),
        children:[
          {
            path:'mavan',
            name: 'mavan',
            component: () => import(/* webpackChunkName: "mavan" */ '../components/Mavan.vue')
          },
          {
            path:'play',
            name: 'play',
            component: () => import(/* webpackChunkName: "play" */ '../components/Play.vue')
          },
          {
            path: 'cinema',
            name: 'cinema',
            component: () => import(/* webpackChunkName: "cinema" */ '../views/Cinema.vue')
          },
        ]
      },
      {
        path: 'personalcenter',
        name: 'personalcenter',
        component: () => import(/* webpackChunkName: "personalcenter" */ '../views/PersonalCenter.vue')
      },     
    ],
  },
  {
    path:"/filmdetails",
    name: 'filmdetails',
    component: () => import(/* webpackChunkName: "filmdetails" */ '../views/Filmdetails.vue')
  },
  {
    path:'/seat',
    name:'seat',
    component: () => import(/* webpackChunkName: "seat" */ '../views/Seat.vue')
  },
  {
    path: '/details',
    name: 'details',
    component: () => import(/* webpackChunkName: "details" */ '../views/Details.vue')
  },
  {
    path: '/choicecinema',
    name: 'choicecinema',
    component: () => import(/* webpackChunkName: "details" */ '../views/ChoiceCinema.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
export default router
